<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
        <tr>
            <td>
            	选择年月：
        		<input id="select_month" class="mini-monthpicker" format="yyyy—MM" tooltip="请选择年月" allowInput="false" style="width:100px;"/>
				<a class="mini-button" iconCls="icon-search" onclick="search()">查询</a>
            </td>
        </tr>
    </table>           
</div>

<div class="mini-fit" >
<div id="container3" style="min-width: 310px; height: 100%;width: 100%;"></div>
</div>

<script type="text/javascript">

mini.parse();
var myDate = new Date();
var year = myDate.getFullYear();
var mounth = myDate.getMonth() + 1;
var text = ''+year+'年'+mounth+'月会员购买力月份统计图';
var data = [];

var selectMonth = mini.get("select_month");
var myDate = new Date();
var sm = myDate.getFullYear() + '-'+ (myDate.getMonth()+1) +'';
selectMonth.setValue(sm);

var options = {
	chart: {
        type: 'column'
    },
    title: {
        text: ''+year+'年'+mounth+'月会员购买力月份段分布图'
    },
    xAxis: {
        categories: ['上旬','中旬','下旬']
    },
    yAxis: {
        min: 0,
        allowDecimals: false,
        title: {
            text: '人数'
        }
    },
    plotOptions: {
        column: {
            pointPadding: 0.2,
            borderWidth: 0
        }
    },
    series:[
    {
        name: '每旬人数',
        data: data
    }],
    credits:{
    	text:"",
        href:"javascript:void(0);"
    }
};

function search() {
	view();
}

function view() {
	var chart = $('#container3').highcharts(options);
	data = [];
	$.post("amount_month_view.do", {startTime: selectMonth.getFormValue()}, function(info){
		data = $.parseJSON('[' + info + ']');
		chart = new Highcharts.Chart(options);
		chart.series[0].setData(data);
	}, "json");
}

function onKeyEnter(e) {
    search();
}

$(document).ready(function(){
	view();
});
</script>
</body>
</html>